#ifndef ANIMATORHOLDER_H
#define ANIMATORHOLDER_H

#include "Animator.h"
#include "Timer.h"
#include <list>

class AnimatorHolder {
	static std::list<Animator*> running, suspended, pending_suspention, paused;
	static timestamp_t pauseTime;

	class ProgressFunctor : public std::unary_function<Animator*, void> {
	    timestamp_t t;
	public: 
	    void operator()(Animator* a) const { a->Progress(t); }
	    ProgressFunctor (timestamp_t _t) : t(_t){}
	};
public:
	static void Register (Animator* a);
	static void Cancel (Animator* a);
	static void MarkAsRunning (Animator* a);
	static void MarkAsSuspended(Animator* a);
	static void DelayedSuspention(Animator* a);
	static void Progress(timestamp_t currTime);
	static void Pause(void);
	static void Resume(void);
	static void MarkAsPaused(Animator* a);
	static void MarkAsResumed(Animator* a);
};

#endif